/*
 *Define the base structures of DSQ Chess Board
 *
 *Added one enum type of level for search-depth
 */

#ifndef _CDSQBASEINFO_H
#define _CDSQBASEINFO_H

/*The declarations of constants*/
#define NOCHESS	    0
#define Trap	    21
#define Water       22
#define LHome	    23
#define RHome	    24

#define LMice	    1
#define LCat		2
#define LDog		3
#define LWolf	    4
#define LPanther	5
#define LTiger	    6
#define LLion	    7
#define LElephant   8
#define LBEGIN      LMice
#define LEND        LElephant

#define RMice	    9
#define RCat		10
#define RDog		11
#define RWolf	    12
#define RPanther	13
#define RTiger	    14
#define RLion	    15
#define RElephant   16
#define RBEGIN      RMice
#define REND        RElephant

typedef unsigned char PieceIndex;

extern const PieceIndex InitChessBoard[7][9];

/*****************Macro Judgments****************/
#define IsOther(x)		 (x>20&&x<25)
#define IsLeft(x)		 (x>=LBEGIN&&x<=LEND)
#define IsRight(x)		 (x>=RBEGIN&&x<=REND)
#define IsSameSide(x,y)  ((IsLeft(x)&&IsLeft(y))||(IsRight(x)&&IsRight(y)))
#define GetSide(x)		 (IsRight(x))

#define Left        0
#define Right       1

#define MaxSearchDepth		11
#define MaxPossibleMovement	64

#define Row 7
#define Col 9

typedef struct _PiecePos
{
	PieceIndex	x;
	PieceIndex	y;
}PiecePos, *pPiecePos;

typedef struct _PieceMove
{
	PiecePos	    From;
	PiecePos	    To;
	int Score;
}PieceMove, *pPieceMove;

/************Evaluation of the Board*************/

#define BASEVALUE_Mice		205
#define BASEVALUE_Cat		150
#define BASEVALUE_Dog		200
#define BASEVALUE_Wolf		220
#define BASEVALUE_Panther	300
#define BASEVALUE_Tiger		385
#define BASEVALUE_Lion		400
#define BASEVALUE_Elephant  500

typedef struct _CellPoint
{
    PieceIndex  x;
    PieceIndex  y;
} CellPoint, *pCellPoint;

typedef struct _PieceInfo
{
	PieceIndex nChessID;
	CellPoint ptMovePoint;
} PieceInfo, *pPieceInfo;

enum Level
{
	Beginner	= 2,
	Amateur		= 3,
	Regular		= 4,
	Professinal = 5,
	TopPlayer	= 6,
	WorldClass	= 7
};
#endif //_CDSQBASEINFO_H